import api from './api'

class OrderApi extends api {
  /**
   * 获取订单价格
   * @param {*} 参数
   */
  confirmPrice (info) {
    return this.request({
      url: `${this.servicePath}/${this.modulePath}/confirmPrice`,
      method: 'post',
      data: info
    })
  }

  confirmPhoto (orderId, data) {
    return this.request({
      url: `${this.servicePath}/${this.modulePath}/confirmPhoto/${orderId}`,
      method: 'post',
      data
    })
  }

  /**
   * 取消订单
   * @param {*} orderId 订单id
   * @param {*} remark 备注
   */
  cancel (orderId, remark) {
    return this.request({
      url: `${this.servicePath}/${this.modulePath}/cancel/${orderId}`,
      method: 'put',
      data: {
        remark
      }
    })
  }

  /**
   * 签收订单
   * @param {*} orderId 订单id
   */
  sign (orderId) {
    return this.request({
      url: `${this.servicePath}/${this.modulePath}/sign/${orderId}`,
      method: 'put'
    })
  }
}

export default new OrderApi('photoStudio/order')
